<?php
class ListAction extends Action{
	public function Index(){
		// p($_GET);die;
		import('Class.Category',APP_PATH);
		import("ORG.Util.Page");
		$pid=$_GET['id'];

		$cate=M('cate')->order('sort')->select();
		
		$cids=Category::getChildsId($cate,$pid);
		$cids[]=$pid;
		$where=	array('cid'=>array('IN',$cids));
		
        // p($blog);die;
         //$this->blog3=$blog; 
        
        $count=M('blog')->where($where)->count();
       // p($count);die;
        $page=new Page($count,5);
        $limit=$page->firstRow.','.$page->listRows;
        $this->bowen=D('BlogView')->getAll($where,$limit);
        $this->page=$page->show();
		$this->display();
	}
}


?>